<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="cn.itcast.itcaststore.domain.User"%>
<script type="text/javascript">
//退出确认框
function exitSys() {
	var flag = window.confirm("确认退出系统吗?");
	if (flag) {
		top.location = "${pageContext.request.contextPath}/client/login.jsp";
		window.top.open('', '_parent', '');
		window.top.close();
	}
	//如果你使用的是firefox浏览器必须要做以下设置
	//1、在地址栏输入about:config然后回车，警告确认
	//2、在过滤器中输入”dom.allow_scripts_to_close_windows“，双击即可将此值设为true 即可完成了

}
</script>
<div id="divhead">
	<table cellspacing="0" class="headtable">
		<tr>
			<td>
				<a href="${pageContext.request.contextPath }/index.jsp">
					<img src="${pageContext.request.contextPath}/client/images/logo.png" width="200" height="60" border="0" />
				</a>
			</td>
			<td style="text-align:right">
				<img src="${pageContext.request.contextPath}/client/images/cart.gif" width="26" height="23" style="margin-bottom:-4px" />
				   &nbsp;
				  <a href="${pageContext.request.contextPath}/client/cart.jsp">购物车</a>
				| <a href="#">帮助中心</a>
				| <a href="${pageContext.request.contextPath}/client/myAccount.jsp">我的帐户</a>
				<%
				User user = (User) request.getSession().getAttribute("user");
				if(null == user){
				%>
				| <a href="${pageContext.request.contextPath}/client/login.jsp">登录</a>
				<%
				}else{
				%>
				|

				<a href="${pageContext.request.contextPath}/logout "   onclick="exitSys()">用户退出</a>
				<br><br><br>欢迎您： ${user.username}
				<%
				}
				%>
			</td>
		</tr>
	</table>
</div>
